/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Client;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.net.ssl.SSLSocket;

/**
 *
 * @author tambeotb4
 */
public class ClientSocketHandle extends Thread{
    private Socket soc;
    private BufferedReader in;
    private PrintWriter out;
    private String serverName;
    private String clientName;
    private int port;
     public ClientSocketHandle(String serverName,String clientName,int port) throws UnknownHostException, IOException{
         this.serverName = serverName;
         this.clientName = clientName;
         this.port = port;
         soc = new Socket(serverName, port);
     }
    @Override
     public void run(){
        try {
            out = new PrintWriter(soc.getOutputStream(), true);
             in = new BufferedReader(new InputStreamReader(soc.getInputStream()));
             out.println("Hello");
             out.flush();
             out.println("HIHello");
             out.flush();
        } catch (IOException ex) {
            Logger.getLogger(ClientSocketHandle.class.getName()).log(Level.SEVERE, null, ex);
        }
     }

}
